package com.medvalley.tcm.controller;

import com.medvalley.tcm.base.Result;
import com.medvalley.tcm.domain.Questionnaire;
import com.medvalley.tcm.pojo.QuestionnairePojo;
import com.medvalley.tcm.service.QuestionnaireService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class BodyController extends BaseController {

    @Autowired
    private QuestionnaireService questionnaireService;

    public Result saveBody(@ModelAttribute QuestionnairePojo questionnairePojo, HttpServletRequest request) {
        String sessionPhone = getSessionPhone(request);
        Questionnaire questionnaire = new Questionnaire();
        BeanUtils.copyProperties(questionnaire, questionnairePojo);
        return success();
    }

}
